﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using LIMS.Entities;
using NHibernate;
using NHibernate.Cfg;
using System.Collections;
using Castle.Core.Logging;

namespace LIMS.DataAccess
{
    /// <summary>
    /// Concrete DAO for accessing instances of <see cref="Customer" /> from DB.
    /// </summary>
    public class UserDao : AbstractDBA<User>, IUserDao
    {
        public UserDao(string sessionFactoryConfigPath, ILogger oLogger) : base(sessionFactoryConfigPath,oLogger ) 
        { 
            
        }

        public string GetUserPasswordByUserId(int Id)
        {
            System.Data.IDbCommand command = NHibernateSession.Connection.CreateCommand();
            command.CommandText = "SELECT PASSWORD FROM USERS WHERE ID=" + Id;
            return command.ExecuteScalar().ToString();  
        }
    }

}
